﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="show-comments.aspx.cs"
    Inherits="SocialShare.Web.Blogs.show_comments" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="<%= Utilities.SiteSettings.BaseUrl %>Scripts/jquery-1.5.1.js" type="text/javascript"></script>
    <script src="<%= Utilities.SiteSettings.BaseUrl %>scripts/jquery.tmpl.js" type="text/javascript"></script>
    <link rel="stylesheet" href="<%= Utilities.SiteSettings.BaseUrl %>scripts/Grid/loader.css" />
    <link href="../App_Style/CSS/reset.css" rel="stylesheet" type="text/css" />
    <link href="../App_Style/CSS/960.css" rel="stylesheet" type="text/css" />
    <link href="../App_Style/CSS/text.css" rel="stylesheet" type="text/css" />
    <link href="../App_Style/CSS/Forms.css" rel="stylesheet" type="text/css" />
    <link href="../App_Style/CSS/Layout.css" rel="stylesheet" type="text/css" />
    <link href="../App_Style/CSS/buttons.css" rel="stylesheet" type="text/css" />
    <link href="../App_Style/CSS/comments.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function () {
            LoadData();
        });

       
        function LoadData() {
            //var blogId = $.urlParam('BlogId');

            $.ajax({
                type: "GET",
                url: "../Services/SocialShare_Service.svc/SocialShare_Blog_Comments?$filter=BlogId eq 2",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                beforeSend: function () { $("#wait").show(); },
                complete: function () { $("#wait").hide(); },
                success: function (data) {
                    $("#commentlist").html("");

                    $.each(data.d, function (i, item) {
                        var col0 = "<img src='../App_Style/Images/avatar.png'/>" + item.UserName + " says: ";
                        var col1 = $("<div class='grid_8 alpha' />").html(col0);
                        var col4 = $("<hr class='grid_8 alpha' />");
                        var col2 = $("<div class='grid_8 alpha' />").html("<span class='comment-header'>12/5/2011</span>");
                        var col3 = $("<div class='grid_8 alpha'/>").html(item.Comments);
                        $("<li class='comment'><div>").append(col1).append(col2).append(col3).append(col4).append("</div></li>").appendTo("#commentlist"); ;

                    });

                },
                error: function (msg) {
                    alert(msg);
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    
    <section class="container_12 content clearfix">
    <section class="grid_12 clearfix omega">
<section id="wait" class="progress grid_5">
  <section class="progress-container">
        <section class="progress-header">Loading, please wait...</section>
        <section class="progress-body">
            <img src="../Scripts/Grid/pre-loader.gif" />
        </section>
    </section>
  
  </section>
  <section class="grid_7">
  &nbsp;
  </section>
</section>
<section class="grid_8 alpha show-text">
   <label class="title-regular">Comments</label>
   <br /><br />
  <ol id="commentlist">	
	</ol>
    </section>
    </section>
    </form>
</body>
</html>
